#include "greedy.h"

Greedy::Greedy()
{

}

int Greedy::maxJump(vector<int> &stones)
{
    // 只有首尾节点的情况的特判
    int res = stones[1] - stones[0];
    // 遍历所有跨度为1的跳跃
    for (int i=2; i < stones.size(); ++i)
        res = res > (stones[i] - stones[i-2]) ? res : (stones[i] - stones[i-2]);
    return res;
}
